Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify wCurrentMapScriptFlags bits #467

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

Rangi42
Copy link
Member

@Rangi42 Rangi42 commented Sep 24, 2024

BIT_CUR_MAP_LOADED_1 is the more frequently used flag, mostly used for updating map blocks (when you use a Card Key, press a switch, enter an Elite 4 room, etc).

BIT_CUR_MAP_LOADED_2 is mostly used for making Gyms load their statue sign names, and never re-set (with one exception in GameCorner.asm, which uses it to select a lucky slot machine, and re-sets it when the Rocket runs away).

But since they're not exclusively for "changing blocks" and "loading Gym names", I didn't want to name the constants after those.

@Vortyne
Copy link
Contributor

Vortyne commented Sep 24, 2024

BIT_MAP_LOADED
BIT_MAP_LOADED_2

Would be my preference...I realize in a couple of cases they are set in the map script itself to re-trigger onLoad functions (PokemonMansion2F.asm) but I feel "map was just loaded" is the intention of the bits. Anyone adding to the game code would be using these bits exclusively as a "map was just loaded" flag and instead of re-setting these in the map script to re-trigger the functions later...just calling those functions directly instead.

@Rangi42
Copy link
Member Author

Rangi42 commented Sep 24, 2024

Sure, renamed BIT_CUR_MAP_SCRIPT_1/2 to BIT_CUR_MAP_LOADED_1/2.

@Vortyne
Copy link
Contributor

Vortyne commented Sep 24, 2024

can we do BIT_CUR_MAP_LOADED without the suffix for the first one?

@Rangi42
Copy link
Member Author

Rangi42 commented Sep 24, 2024

I'd prefer not to; that would seem to imply it's the bit for checking if a current map has loaded, when it's really one of a coequal pair.

ram/wram.asm Outdated Show resolved Hide resolved
ram/wram.asm Outdated Show resolved Hide resolved
@Rangi42 Rangi42 requested a review from dannye September 24, 2024 15:33
@Rangi42 Rangi42 merged commit 635b9c4 into pret:master Sep 24, 2024
1 check passed
@Rangi42 Rangi42 deleted the cur-map-script-flags branch September 24, 2024 15:39
github-actions bot pushed a commit that referenced this pull request Sep 24, 2024
PokefanMarcel pushed a commit to PokefanMarcel/pokered that referenced this pull request Oct 18, 2024
PokefanMarcel added a commit to PokefanMarcel/pokered that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants